home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 April: Mac OS SDK / Dev.CD Apr 00 SDK1.toast / Development Kits / Mac OS / UPDATE- Int&Libs 3.2 / PInterfaces / MacLocales.p < prev    next >
Encoding:
Text File  |  1999-05-25  |  4.8 KB  |  134 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        MacLocales.p
  3.  
  4.      Contains:    Types & prototypes for locale functions
  5.  
  6.      Version:    Technology:    Veronica
  7.                  Release:    Veronica Seed, Use with 3.2 Universal Interfaces
  8.  
  9.      Copyright:    © 1998-1999 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. }
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT MacLocales;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __MACLOCALES__}
  27. {$SETC __MACLOCALES__ := 1}
  28.  
  29. {$I+}
  30. {$SETC MacLocalesIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33. {$IFC UNDEFINED __MACTYPES__}
  34. {$I MacTypes.p}
  35. {$ENDC}
  36.  
  37.  
  38. {$PUSH}
  39. {$ALIGN MAC68K}
  40. {$LibExport+}
  41.  
  42. {
  43.    -------------------------------------------------------------------------------------------------
  44.    ERROR/STATUS CODES
  45.    -------------------------------------------------------------------------------------------------
  46. }
  47.  
  48.  
  49. CONST
  50.     kLocalesBufferTooSmallErr    = -30001;
  51.     kLocalesDefaultDisplayStatus = -30029;                        {  Requested display locale unavailable, used default }
  52.  
  53. {
  54.    -------------------------------------------------------------------------------------------------
  55.    TYPES & CONSTANTS
  56.    -------------------------------------------------------------------------------------------------
  57. }
  58.  
  59.  
  60. TYPE
  61.     LocaleRef = ^LONGINT;
  62.     LocalePartMask                        = UInt32;
  63.  
  64. CONST
  65.                                                                 {  bit set requests the following: }
  66.     kLocaleLanguageMask            = $00000001;                    {  ISO 639-1 or -2 language code (2 or 3 letters) }
  67.     kLocaleLanguageVariantMask    = $00000002;                    {  custom string for language variant }
  68.     kLocaleScriptMask            = $00000004;                    {  ISO 15924 script code (2 letters) }
  69.     kLocaleScriptVariantMask    = $00000008;                    {  custom string for script variant }
  70.     kLocaleRegionMask            = $00000010;                    {  ISO 3166 country/region code (2 letters) }
  71.     kLocaleRegionVariantMask    = $00000020;                    {  custom string for region variant }
  72.     kLocaleAllPartsMask            = $0000003F;                    {  all of the above }
  73.  
  74.  
  75. TYPE
  76.     LocaleOperationClass                = FourCharCode;
  77.  
  78. CONST
  79.     kUnicodeCollationClass        = 'ucol';
  80.     kUnicodeTextBreakClass        = 'ubrk';
  81.  
  82.  
  83. TYPE
  84.     LocaleOperationVariant                = FourCharCode;
  85.     LocaleAndVariantPtr = ^LocaleAndVariant;
  86.     LocaleAndVariant = RECORD
  87.         locale:                    LocaleRef;
  88.         opVariant:                LocaleOperationVariant;
  89.     END;
  90.  
  91.     LocaleNameMask                        = UInt32;
  92.  
  93. CONST
  94.                                                                 {  bit set requests the following: }
  95.     kLocaleNameMask                = $00000001;                    {  name of locale }
  96.     kLocaleOperationVariantNameMask = $00000002;                {  name of LocaleOperationVariant }
  97.     kLocaleAndVariantNameMask    = $00000003;                    {  all of the above }
  98.  
  99. {
  100.    -------------------------------------------------------------------------------------------------
  101.    FUNCTION PROTOTYPES
  102.    -------------------------------------------------------------------------------------------------
  103. }
  104.  
  105. {  Convert to or from LocaleRefs  }
  106.  
  107. FUNCTION LocaleRefFromLangOrRegionCode(lang: LangCode; region: RegionCode; VAR locale: LocaleRef): OSStatus; C;
  108. FUNCTION LocaleRefFromLocaleString(localeString: ConstCStringPtr; VAR locale: LocaleRef): OSStatus; C;
  109. FUNCTION LocaleRefGetPartString(locale: LocaleRef; partMask: LocalePartMask; maxStringLen: ByteCount; partString: CStringPtr): OSStatus; C;
  110. {  Enumerate locales for a LocaleOperationClass  }
  111.  
  112. FUNCTION LocaleOperationCountLocales(opClass: LocaleOperationClass; VAR localeCount: ItemCount): OSStatus; C;
  113. FUNCTION LocaleOperationGetLocales(opClass: LocaleOperationClass; maxLocaleCount: ItemCount; VAR actualLocaleCount: ItemCount; VAR localeVariantList: LocaleAndVariant): OSStatus; C;
  114. {  Get names for a locale }
  115.  
  116. FUNCTION LocaleGetName(locale: LocaleRef; opVariant: LocaleOperationVariant; nameMask: LocaleNameMask; displayLocale: LocaleRef; maxNameLen: UniCharCount; VAR actualNameLen: UniCharCount; VAR displayName: UniChar): OSStatus; C;
  117. FUNCTION LocaleCountNames(locale: LocaleRef; opVariant: LocaleOperationVariant; nameMask: LocaleNameMask; VAR nameCount: ItemCount): OSStatus; C;
  118. FUNCTION LocaleGetIndName(locale: LocaleRef; opVariant: LocaleOperationVariant; nameMask: LocaleNameMask; nameIndex: ItemCount; maxNameLen: UniCharCount; VAR actualNameLen: UniCharCount; VAR displayName: UniChar; VAR displayLocale: LocaleRef): OSStatus; C;
  119. {  Get names for a LocaleOperationClass }
  120.  
  121. FUNCTION LocaleOperationGetName(opClass: LocaleOperationClass; displayLocale: LocaleRef; maxNameLen: UniCharCount; VAR actualNameLen: UniCharCount; VAR displayName: UniChar): OSStatus; C;
  122. FUNCTION LocaleOperationCountNames(opClass: LocaleOperationClass; VAR nameCount: ItemCount): OSStatus; C;
  123. FUNCTION LocaleOperationGetIndName(opClass: LocaleOperationClass; nameIndex: ItemCount; maxNameLen: UniCharCount; VAR actualNameLen: UniCharCount; VAR displayName: UniChar; VAR displayLocale: LocaleRef): OSStatus; C;
  124. {$ALIGN RESET}
  125. {$POP}
  126.  
  127. {$SETC UsingIncludes := MacLocalesIncludes}
  128.  
  129. {$ENDC} {__MACLOCALES__}
  130.  
  131. {$IFC NOT UsingIncludes}
  132.  END.
  133. {$ENDC}
  134.